package com.zhangbo.study.designpatternlearning.command;

/**
 * 命令模式运行类
 */
public class CommandRun {

    public static void main(String[] args) {
        Light light = new Light();
        Command on = new LightOnCommand(light);

        Command off = new LightOffCommand(light);

        SimpleRemoteControl simpleRemoteControl = new SimpleRemoteControl(on,off);

        simpleRemoteControl.buttonWasLightOn();
        simpleRemoteControl.buttonWasLightOff();
    }

}
